package com.hzf.ucenter.admin.controller.manage;

import com.hzf.common.base.BaseController;
import com.hzf.ucenter.dao.model.UcenterUserAuthExample;
import com.hzf.ucenter.rpc.api.UcenterUserAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * describe: 认证操作
 * creat_user: 白开水
 * creat_time: 2017/11/13   10:27
 **/
@Controller
@Api(value = "平台基础用户管理", description = "基础用户管理")
@RequestMapping("/ucenter/ucenterAuth")
public class UcenterAuthController extends BaseController{
    private static Logger _log = LoggerFactory.getLogger(UcenterUserController.class);

    @Autowired
    private UcenterUserAuthService ucenterUserAuthService;

    @ApiOperation(value = "认证用户首页")
    @RequiresPermissions("ucenter:userauth:read")
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index() {
        System.out.println("!!!!!!!");
        return "/manage/userAuth/index.jsp";
    }

    @ApiOperation(value="获取认证列表")
    @RequiresPermissions("ucenter:user:read")
    @RequestMapping(value="/list",method = RequestMethod.GET)
    @ResponseBody
    public Object list(@RequestParam(required = false, defaultValue = "0", value = "offset") int offset,
                       @RequestParam(required = false, defaultValue = "10", value = "limit") int limit,
                       @RequestParam(required = false, value = "sort") String sort,
                       @RequestParam(required = false, value = "order") String order){
        UcenterUserAuthExample ucenterUserAuthExample = new UcenterUserAuthExample();

        if(!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)){
            ucenterUserAuthExample.setOrderByClause(sort+" "+order);
        }

        return "";
    }


}
